<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"   
      xmlns:f="http://java.sun.com/jsf/core">
    <link type="text/css" rel="stylesheet" href="../style.css" />
    <link type="text/css" rel="stylesheet" href="style.css" />
    <h:head>
        <title>Update Claims</title>
    </h:head>
    <h:body styleClass="form">
        <h:form>
            <p><br></br></p>
            <p><br></br></p>
            <p>
                <h:link value="home" outcome="homePage"/>
                <br/>
            </p>
            <p>
                <h:outputLabel for="claimDrpDown" value="Claims:" />
                <h:selectOneMenu id="claimDrpDown" value="#{garageManager.id}">
                    <f:selectItems value="#{garageManager.claimIdLst}" />
                    <f:ajax event="change" listener="#{garageManager.refreshClaimDetails}" render="id regno year repaircost" />
                </h:selectOneMenu> 
                <br/>
                <br/>
                <h:panelGrid columns="2" id="panel" border="1" styleClass="cart-table" headerClass="cart-table-header"
                             footerClass="footer">
                    <f:facet name="header">
                        <h:outputText value="Claim Details"/>
                    </f:facet>
                    <h:outputLabel for="id" value="Claim id:" />
                    <h:outputText id="id" value="#{garageManager.id}" />
                    <h:outputLabel for="regno" value="Car Registration Number:" />
                    <h:outputText id="regno" value="#{garageManager.carRegNo}" />
                    <h:outputLabel for="year" value="Car Year:" />
                    <h:outputText id="year" value="#{garageManager.carYear}" />
                    <h:outputLabel for="repaircost" value="Repair Cost:" />
                    <h:inputText id="repaircost" value="#{garageManager.carRepairCost}" />
                    <h:outputLabel for="status" value="Status:" />
                    <h:inputText id="status" value="#{garageManager.carStatusDesc}" />
                    <f:facet name="footer">
                        <h:panelGroup style="display:block; text-align:center">
                            <h:commandButton id="update" value="Update" action="#{garageManager.update}"/>
                        </h:panelGroup>
                    </f:facet>
                </h:panelGrid>
                <br/>
            </p>
        </h:form>
    </h:body>
</html>

